package speed2010.reformulacao.dao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

//Connection to the HSQLDB Server to load the User Profiles
public class ConnectionFactory {
	public Connection getConnection() {
		try {
			// Uncomment for MySQL
			//return DriverManager.getConnection("jdbc:mysql://localhost/test","root", "");

			// Uncomment for HSQLDB FILE
			//return DriverManager.getConnection("jdbc:hsqldb:file:" + System.getProperty("user.dir") + "/db/test;shutdown=true", "sa", "");
			
			// Uncomment for HSQLDB SERVER
			return DriverManager.getConnection("jdbc:hsqldb:hsql://localhost", "SA", "");
			
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
}